GetEnumerator Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Returns an enumerator that enumerates all the entries in the dictionary. Each entry is returned as a KeyValuePair<TKey,TValue>. The entries are enumerated in the sorted order of the keys.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public override sealed IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Visual Basic (Declaration)
Public Overrides NotOverridable Function GetEnumerator As IEnumerator(Of KeyValuePair(Of TKey, TValue))
Visual C++
public:
virtual IEnumerator<KeyValuePair<TKey, TValue>>^ GetEnumerator () override sealed

Return Value

An enumerator for enumerating all the elements in the OrderedDictionary.

Remarks

Typically, this method is not called directly. Instead the "foreach" statement is used to enumerate the elements of the dictionary, which uses this method implicitly.

If an element is added to or deleted from the dictionary while it is being enumerated, then the enumeration will end with an InvalidOperationException.

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number of entries in the dictionary.

See Also